package com.kgc.springboot.aviation.service.lvwenjia.impl;

import com.kgc.springboot.aviation.mapper.OpinionMapper;
import com.kgc.springboot.aviation.pojo.Opinion;
import com.kgc.springboot.aviation.pojo.OpinionExample;
import com.kgc.springboot.aviation.service.lvwenjia.OpinionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author shkstart
 * @create 2021-01-04 18:26
 */
@Service
public class OpinionServiceImpl implements OpinionService
{
    @Resource
    OpinionMapper opinionMapper;
    @Override
    public int insertOpinion(Opinion opinion) {
        int i = opinionMapper.insertSelective(opinion);
        return i;
    }

    @Override
    public List<Opinion> getOpinionList() {
        OpinionExample opinionExample=new OpinionExample();
        return opinionMapper.selectByExample(opinionExample);
    }

    @Override
    public Opinion selectOpinionById(Integer id) {
        Opinion opinion = opinionMapper.selectByPrimaryKey(id);
        return opinion;
    }
}
